<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class Student extends Model
{
    public $fillable = [
      'photo', 'name', 'num', 'school_id', 'age', 'sex'
    ];


    public function school()
    {
        return $this->belongsTo(School::class);
    }

    public function addAll(Array $data)
    {
        return DB::table($this->getTable())->insert($data);
    }
}
